{% extends "template_base.html" %}
{% block title %}DeepyWeb - Submit your csv file!{% endblock %}
{% block script %}
<script>
    $(function () {
        var text = document.getElementById("my_alert").textContent;
        if (text != '') {
            alert(text);
        }
    });

</script>
{% endblock %}
{% block navbar %}
<nav id="navbar" class="navbar">
    <ul>
        <!--<li><a class="nav-link scrollto active " href="#header">Home</a></li>-->
        <li><a class="nav-link scrollto" href="/welcome">主 页</a></li>
        {% if not logged %}
        <li><a class="getstarted scrollto" href="login">登 录</a></li>
        {% endif %}
        {% if logged %}
        <li><a class="getstarted scrollto" href="logout">登 出</a></li>
        {% endif %}

    </ul>
    <i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
{% endblock %}

{% block main %}
<main id="main">
    <span id="my_alert" style="display:none;">{{my_alert}}</span>
    <!-- ======= Breadcrumbs ======= -->
    <section class="breadcrumbs">
        <div class="container">
            <ol>
                <!-- href 可能要改 -->
                <li><a href="/select_to_start">Select</a></li>
            </ol>
            <h2>SUBMIT YOUR FILE</h2>
        </div>
    </section>
    <!-- End Breadcrumbs -->

    <section id="query" class="query">

        <div class="container" data-aos="fade-up">

            <header class="section-header">
                <h2>You are submitting file for {{ task_type }}</h2>
                <h2>Submit Your File Here</h2>
                <p>请 提 交 您 的 .csv 文 件</p>
            </header>
            <form class="user" id = "submitFile" name="submitFile" action="" enctype='multipart/form-data' method='POST'>
                <div class="form-group">
                    <center>
                        <input type="file" class="form-control form-control-user" name="myFile"
                               style="width:500px; height:36px;border-radius: 10px;border-color:gainsboro;
                        border-style: solid;mso-border-shadow: yes;outline: none;"></center>
                </div>

                <br>

                <div class="form-group">
                    <center><input type="text" class="form-control form-control-user" name="task_description"
                                   placeholder="请输入您的文件描述..."
                                   style="width:500px; height:36px;border-radius: 10px;border-color:gainsboro;
                        border-style: solid;mso-border-shadow: yes;outline: none;"></center>
                </div>

                <br>
                <br>
                <div class="text-center" style="margin: 0 auto;">
                    <a onclick="submitFile.submit();"
                       class="btn btn-primary btn-user btn-block"
                       style=" padding: 12px 25px;
                               border-radius: 4px;
                               transition: 0.5s;">
                        <span>下 一 步 &nbsp;</span>
                        <i class="bi bi-arrow-right"></i>
                    </a>
                </div>
            </form>

            <div class="row" style="position:relative;">
                <br>
                <br>
                <br>
                <br>
            </div>

        </div>

    </section><!-- End Query Section -->

</main>
<!-- End #main -->
{% endblock %}